package com.cosina.game.colorball;

public enum Difficulty {
	EASY(3),NORMAL(4),HARD(5);
	
	private int code;
	
	Difficulty(int code){
		this.code =code;
	}
	
	public int getCode(){
		return code;
	}
	
	public static Difficulty getByCode(int code){
		switch (code) {
		case 3:
			return EASY;
		case 4:
			return NORMAL;
		case 5:
			return HARD;
		}
		return null;
	}
	
	public static String[] stringValues(){
		Difficulty[] objectValues = Difficulty.values();
		String[] values = new String[objectValues.length];
		for(int i=0; i<values.length; i++){
			values[i] = objectValues[i].toString();
		}
		return values;
	}
	
	public static String desc(int dif){
		if(3 == dif){
			return "easy";
		}else if(4 == dif){
			return "normal";
		}else if(5 == dif){
			return "hard";
		}
		return "";
	}
}
